import request from '@/utils/request';

export async function queryRule(params) {
//   let obj = {
//     page: params.current,
//     limit: params.pageSize,
//   };
//   Object.assign(params, obj);
  delete params.current;
  delete params.pageSize;
  return request('/goods/goodsCategory/list?parent=true', {
    params,
  });
}
export async function removeRule(params) {
  return request(`/goods/goodsCategory/${params}`, {
    method: 'DELETE',
  });
}
export async function addRule(params) {
  return request('/goods/goodsCategory', {
    method: 'POST',
    data: {
      ...params,
    },
  });
}
export async function updateRule(params) {
  return request('/goods/goodsCategory', {
    method: 'PUT',
    data: {
      ...params,
    },
  });
}
